let regexp = /world/d;
let str = 'hello world';
let result = regexp.exec(str);
let start = result.indices[0][0];
let end = result.indices[0][1];
console.log(start,end);
console.log(str.substring(start,end));
//[ 'hello world', index: 0, input: 'hello world', groups: undefined ]
/**
[
  'hello world',
  index: 0,
  input: 'hello world',
  groups: undefined,
  indices: [ [ 0, 11 ], groups: undefined ]
]
 */
